package com.yun.space.pro.platform.actiom;

import com.opensymphony.xwork2.ActionContext;
import com.yun.space.base.BaseAction;
import com.yun.space.entity.MainContent;
import com.yun.space.entity.Projects;

public class PlatformAction extends BaseAction<Projects>{
	/*
	 * 	@author CodingFanlt
	 *  获取平台建设相关信息
	 */
	public String toPlatformConstruction() {
		// 获取指定文章
		ActionContext.getContext().getValueStack().set("projects",projectService.findAll());
		return "toPlatformConstruction";
	}

	/**
	 * 确定平台建设编辑信息
	 * li
	 * @return
	 */
	public String edit(){
		getModel().setId(1);
		// 获取指定文章
		ActionContext.getContext().getValueStack().set("projects", projectService.getById(getModel().getId()));
		return "edit";
	}
	/**
	 * 确定编辑信息
	 * li
	 * @return
	 */
	public String newedit(){
		getModel().setId(1);
		System.out.println(getModel());
		projectService.update(getModel());
		// 获取指定文章
		ActionContext.getContext().getValueStack().set("projects", projectService.getById(getModel().getId()));
		return "newedit";
	}

}
